home *** CD-ROM | disk | FTP | other *** search
/ PsL Monthly 1993 December / PSL Monthly Shareware CD-ROM (December 1993).iso / prgmming / dos / pascal / tpfort.com / FORTLINK.DOC < prev    next >
Encoding:
Text File  |  1989-11-18  |  1.7 KB  |  50 lines

  1. unit FortLink;
  2.  
  3. { TPFORT unit to link in fortran routines.  See TPFORT.DOC for instructions. }
  4. { This file contains the interface section only.                             }
  5.  
  6. interface
  7.   uses Dos;
  8.  
  9. type
  10.   Extval     = longint;
  11.   Double_Ptr = ^double;
  12.   RealArray  = array[1..65520 div sizeof(double)] of double;
  13.  
  14. const
  15.   MaxProcs  = 32;  { Recompile this as large as necessary.
  16.                      Overhead is 4*maxprocs }
  17.   Extra_Space : word = 1024;  { Extra space for the Fortran loader's heap.  
  18.                                 Increase if loadfort fails with Exec error 8
  19.                                 or Fortran complains }
  20. var
  21.   FortLoaded    : boolean;   { True indicates Fortran routines are in memory }
  22.   FortSafe      : boolean;   { True indicates you're in Fortran mode }
  23.  
  24. function LoadFort(Prog:string;TPentry:pointer):boolean;
  25. { The procedure to load the fortran routines.  Returns true on success. }
  26.  
  27. procedure CallFort(ProcNum:word);
  28. { The procedure to call the Fortran routine number procnum }
  29.  
  30. procedure FDouble(ProcNum:word);
  31. { Procedure which simulates a Fortran double precision function call }
  32.  
  33. function Fort_External(ProcNum:word):Extval;
  34. { Returns value to be passed as an external reference }
  35.  
  36. function Pas_External(Proc:pointer):Extval;
  37. { Returns value to be passed as an external reference for
  38.   a Pascal procedure or specially constructed function
  39. }
  40.  
  41. procedure Clean_External;
  42. { Routine to clean up stack after Fort_External or Pas_External }
  43.  
  44. procedure Enter_Pascal;
  45. { Set up Pascal context. Always pair with Leave_Pascal! }
  46.  
  47. procedure Leave_Pascal;
  48. { Restore Fortran context. Always pair with Enter_Pascal! }
  49.  
  50.